package com.example.demo.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Description:用户状态
 *
 * @Author zmf
 * @Date 2018/8/31  22:54
 */
public enum UserStatus {

    USER_IN_USE("在用",1),
    USER_CANCEL("注销",2),
    USER_BE_REVIEWED("待审核",3),
    USER_REJECT("驳回",4),
    USER_LOCK("锁定",5);

    private String nameCn;
    private Integer value;

    UserStatus(String nameCn, Integer value){
        this.nameCn = nameCn;
        this.value=value;
    }

    public String getNameCn() {
        return nameCn;
    }
    public Integer getValue() {
        return value;
    }

    public static List<Map<String, Object>> getValues(){
        List<Map<String, Object>> list=new ArrayList<>();
        for (UserStatus status: UserStatus.values()){
            if(!status.equals(UserStatus.USER_CANCEL)){
                Map<String, Object> map= new HashMap<>();
                map.put("nameCn",status.nameCn);
                map.put("value",status.value);
                list.add(map);
            }
        }
        return list;
    }

}
